load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "scheduledjobs",
    srcs = [
        "env.go",
        "rewrite_cron_expr.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/scheduledjobs",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/base",
        "//pkg/kv",
        "//pkg/kv/kvserver/protectedts",
        "//pkg/security/username",
        "//pkg/settings/cluster",
        "//pkg/sql/isql",
        "//pkg/util/hlc",
        "//pkg/util/timeutil",
        "//pkg/util/uuid",
    ],
)

go_test(
    name = "scheduledjobs_test",
    srcs = ["rewrite_cron_expr_test.go"],
    data = glob(["testdata/**"]),
    embed = [":scheduledjobs"],
    deps = [
        "//pkg/testutils/datapathutils",
        "//pkg/util/uuid",
        "@com_github_cockroachdb_datadriven//:datadriven",
        "@com_github_robfig_cron_v3//:cron",
        "@com_github_stretchr_testify//require",
    ],
)
